package patten.xingwei.observer;

/**
 * Description：TODO
 * Author：zwenzhi
 * Date：2023/11/17 9:26
 */
public class Client {
    public static void main(String[] args) {
        Product xigua = new Product("西瓜");
        Product nangua = new Product("南瓜");

        ShipCarShowObserver shipCarShowObserver = new ShipCarShowObserver();
        TotalAmountObserver totalAmountObserver = new TotalAmountObserver();

        ShipCarSubject shipCarSubject = new ShipCarSubject();
        shipCarSubject.addObserver(shipCarShowObserver);
        shipCarSubject.addProduct(xigua);

        shipCarSubject.addObserver(totalAmountObserver);
        shipCarSubject.addProduct(nangua);


    }
}
